package com.gome.ss.flowcrawl.extractor;

import com.mongodb.DBObject;

public class FlowCrawlExtractorConfigField {
	private String id = "";
	private String type = "";
	private boolean multiple = false;
	private boolean index = false;
	private String selectQuery = "";
	private String key = "";
	private String script = "";
	
	public FlowCrawlExtractorConfigField(DBObject obj) {
		id = (String) obj.get("id");
		type = (String) obj.get("datatype");
		multiple = (Boolean) obj.get("ismultiple");
		selectQuery = (String) obj.get("selectQuery");
		key = (String) obj.get("key");
		
		if (obj.get("script") != null)
			script = (String) obj.get("script");
		
		if (obj.get("isindex") != null)
			index = (Boolean) obj.get("isindex");
	}

	public String getId() {
		return id;
	}

	public String getType() {
		return type;
	}

	public boolean isMultiple() {
		return multiple;
	}

	public String getSelectQuery() {
		return selectQuery;
	}

	public String getKey() {
		return key;
	}

	public String getScript() {
		return script;
	}

	public boolean isIndex() {
		return index;
	}
}
